<template>
  <div>

  </div>
</template>

<script>
export default {
    beforeCreate() {
        console.log(window.location.href)
         let urlParam = decodeURI('code=CODE&state=STATE')
        // let urlParam = decodeURI(window.location.search)
        if (urlParam) {
            console.log(urlParam, '=切割路径')
            let wxMessage = urlParam.split('&')
            let wxCode = wxMessage[0].split('=')[1]
            let state = wxMessage[1].split('=')[1]
            if(wxMessage[0].split('=')[0] == 'state'){
                alert('用户取消授权')
                this.$router.push({path:'/home'})
                return
            }
            
            console.log(wxCode, '=code')
            console.log(state, 'state')
        }
    }
}
</script>

